Skip to content

Conversation

@tetienne
Copy link
Collaborator

@tetienne tetienne commented Jan 9, 2026

Summary

  • Use sets for key membership checks (O(1) lookup vs O(n) for lists)
  • Simplify list iteration in obfuscate_sensitive_data by checking for dict directly instead of excluding other types
  • Remove obsolete pylint disable comment
  • Use tuple for value membership check since values can be unhashable types

Test plan

  • Existing tests pass
  • Pre-commit checks pass

- Use tuple instead of set for value membership since values can be
  unhashable types (list, dict)
- Revert obfuscate_string type signature to str only
@tetienne tetienne marked this pull request as ready for review January 9, 2026 09:10
@tetienne tetienne requested a review from iMicknl as a code owner January 9, 2026 09:10
@iMicknl iMicknl requested a review from Copilot January 12, 2026 10:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the obfuscate_sensitive_data function to improve performance and code maintainability through more efficient data structures and simplified control flow.

Changes:

  • Converts list-based membership checks to sets for O(1) lookup performance on key checks
  • Simplifies list iteration logic by directly checking for dict types instead of excluding all other types
  • Removes obsolete pylint disable comment after branch reduction

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@iMicknl iMicknl merged commit 9bd7625 into main Jan 12, 2026
10 checks passed
@iMicknl iMicknl deleted the refactor/improve-obfuscate-types-and-clarity branch January 12, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants